﻿using System;
using System.Collections.Generic;
using KC.DTO.Account;
using KC.DTO.Core;
using KC.Service.Core.Enums.WorkFlow;
using KC.Framework.Base;
using KC.Service.Core.DTO.WorkFlow;

namespace KC.Service.Core.WebApiService.Business
{
    public interface IWorkFlowApiService
    {
        ServiceResult<bool> ApplyFlow(string applycode, WorkFlowTaskDto model, string username);
        ServiceResult<FlowOrigRecordsDto> CancelFlow(int flowid, Guid userid, string usercode, string username);
        ServiceResult<List<Dictionary<string, List<string[]>>>> ErpViewFlowDetail(string workid, ErpFlowConfigs flowconfigs);
        ServiceResult<bool> ExistTenantService();
        ServiceResult<PaginatedBaseDTO<WorkFlowGroupDto>> FindWorkFlowGroup(int pageIndex, int pageSize, string applycode, string operatorid = null);
        ServiceResult<PaginatedBaseDTO<WorkFlowTaskLogDto>> FindWorkFlowTaskLog(int pageIndex, int pageSize, string orderid);
        ServiceResult<List<UserDTO>> GetAllAppUsersByStep(FlowListsDto curStep);
        ServiceResult<PaginatedBaseDTO<WorkFlowTaskDto>> GetAllWorkFlowTask(int pageIndex, int pageSize, string userId, Guid appId);
        ServiceResult<FlowBusiDefaultDto> GetDefautFlowByType(ErpBusiFlowConfig flowConfig);
        ServiceResult<List<string[]>> GetFlowDetailByWorkId(string workid);
        ServiceResult<FlowListsDto> GetFlowStepByFlowIdAndStepId(int flowid, int step);
        ServiceResult<FlowListsDto> GetFlowStepByWorkIdAndFlowid(string workid, int type, int? step = null);
        ServiceResult<FlowOrigRecordsDto> GetOrigRecordById(int id);
        ServiceResult<PaginatedBaseDTO<ApproveDataDto>> GetPagenatedFlowRecordsByFilter(int pageIndex, int pageSize, string appid, int? flowtype, Guid curuserid, string code, string name, string sort);
        ServiceResult<ProcessingState> GetProcessingState(string orderid);
        ServiceResult<FlowResultsDto> GetRecentFlowResultByWorkIdAndFlowId(string workid);
        ServiceResult<int> GetWorkFlowTaskCount(string userId, Guid appId);
        ServiceResult<FlowOrigRecordsDto> ResetFlow(int flowid, Guid userid, string usercode, string username);
        ServiceResult<string> RollBackFlow(FlowBusiBase busiBase);
        ServiceResult<int> StartFlow(FlowOrigRecordsDto origDto);
        ServiceResult<string> UpdateBusinessFlowStat(string url, FlowBusiBase busiBase);
        ServiceResult<bool> UpdateWorkFlowStatus(string url, string applyCode, string id, WorkFlowStatus status);
    }
}